package BookManage;

import BookManage.Operation.*;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 强仔
 * Date: 2022-01-16
 * Time: 11:04
 */
public class NormalUser extends User{

    @Override
    public void StOperation(int choice) {
        iOperations = new IOperation[]{
                new ExitOperation(),
                new FindOperation(),
                new FindByNameOperation(),
                new BorrowOperation(),
                new ReturnOperation()
        };

        iOperations[choice].work();
    }
    @Override
    public int menu() {
        System.out.println("==========================");
        System.out.println("========1.查看所有的图书=====");
        System.out.println("========2.根据名字查找图书====");
        System.out.println("========3.借书==============");
        System.out.println("========4.还书==============");
        System.out.println("========0.退出==============");
        Scanner scanner = new Scanner(System.in);
        System.out.println("请选择您的要求:");
        int choice = scanner.nextInt();
        return choice;
    }
}
